package top.usts.springframework.common;

import top.usts.springframework.beans.PropertyValue;
import top.usts.springframework.beans.PropertyValues;
import top.usts.springframework.beans.factory.ConfigureableListableBeanFactory;
import top.usts.springframework.beans.factory.config.BeanDefinition;
import top.usts.springframework.beans.factory.config.BeanFactoryPostProcessor;

/**
 * @description:
 * @author: CJ
 * @date: 2022/2/23
 */
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {


    @Override
    public void postProcessBeanFactory(ConfigureableListableBeanFactory beanFactory) {
        BeanDefinition beanDefinition = beanFactory.getBeanDefinition("userService");
        PropertyValues propertyValues = beanDefinition.getPropertyValues();
        propertyValues.addPropertyValue(new PropertyValue("company","改为：华住"));
    }
}
